
int add(int x, int y)
{
    int z = x + y;
    return z;
}

int main()
{
    int a = 1;
    int b = 2;
    int c = add(a, b);
    char *ptr = alloca(3);
    ptr[5] = 0xaa;
    return 0;
}

/*
编译命令：
gcc -m32 -Qn -fno-pic -mpreferred-stack-boundary=2 -fno-asynchronous-unwind-tables  -S test_local_var_args.c -o test_local_var_args.s
如果要能跑起来则需要生成位置无关的汇编，汇编整体变化不大
gcc -m32 -Qn -mpreferred-stack-boundary=2 -fno-asynchronous-unwind-tables  -S test_local_var_args.c -o test_local_var_args.s
gcc -fdiagnostics-color=always -m32 -g test_local_var_args.s -o test_local_var_args.out
 gdb test_call_stack.out
*/
